<html>
<head>
<title>Original Title</title>
<link rel="shortcut icon" type="image/x-icon" href="http://test.com/oldfavicon.ico"/>
<link rel="apple-touch-icon" type="image/png" href="http://test.com/i/touch.png"/>
<link rel="apple-touch-icon-precomposed" type="image/png" href="http://test.com/i/touch-precomposed.png"/>
<script src="../../resources/js-test.js"></script>
<script>
function runTests() {
    if (window.testRunner)
        testRunner.dumpAsText();

    debug('Tests that all favicons and touch icons are in document.iconURLs()');

    // Fetch the actual list of icon URLs.
    var actualURLs = internals.allIconURLs(document);

    if (!actualURLs[0] || actualURLs[0] != "http://test.com/oldfavicon.ico") {
        debug("Test failed.. not the right icon on first place in document.iconURLs()")
        return
    }

    if (!actualURLs[1] || actualURLs[1] != "http://test.com/i/touch.png") {
        debug("Test failed.. apple touch icon missing or invalid.")
        return
    }

    if (!actualURLs[2] || actualURLs[2] != "http://test.com/i/touch-precomposed.png") {
        debug("Test failed.. apple touch icon missing or invalid.")
        return
    }

    debug("All icons are preset and in-order in document.iconURLs()")
}
</script>
</head>
<body onload='runTests();'>
</body>
</html>
